package org.javaopenaccess.dao;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
/**
 * This class handels the transactions for db4o.
 * @author Miku
 *
 */
public class TransactionInterceptor implements MethodInterceptor{
	private TransactionManager transactionManager;
	
	public void setTransactionManager(TransactionManager transactionManager) {
		this.transactionManager = transactionManager;
	}
	
	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		return transactionManager.interceptedTransaction(invocation);

	}

}
